#pragma once

#include "common.h"
#include "TblxCommon.h"
#include "CodeFactory.h"
#include "ExcelDataTable.h"

class TblxHelper
{
public:
	TblxHelper(void);
	~TblxHelper(void);

	static std::string generateCodeXs( const stOutput& table  );
	static std::string generateCodeXc( const stOutput& table  );
	static std::string generateCodeXf( const stOutput& table  );

	static std::string generateBinary( const stOutput& table, const ExcelDataTable& data, const Platform platform );


	static std::string encodeTypeDescribeSymbol( 
		const std::string& type, 
		const int size,
		const Platform platform );

	static std::string encodeFieldDescribeSymbol(const stOutput& table, const Platform platform );

	static void generateLine( 
		CodeFactory& code, 
		const std::string& type, 
		const std::string& fieldname, 
		const std::string& note );

	static void writeData( 
		const stField& field, 
		const std::string& value, 
		std::vector< char >& data,
		int& dataoffset,
		std::vector< char >& stringpool,
		int &stringoffset,
		const Platform platform );

	static std::string file_name;
	static std::string sheet_name;
};
